package db

import (
	"fmt"
)

func GetTestCase(ptitle string) map[string]string {

	testcases := make(map[string]string, 10)

	testrows, err := Dd.Query("SELECT * FROM tests WHERE title='" + ptitle + "'")
	if err != nil {
		fmt.Println("Get all tests", err)
		return testcases
	}
	var id int
	var ttitle, input, output string
	for testrows.Next() {
		testrows.Scan(&id, &ttitle, &input, &output)
		testcases[input] = output
	}
	return testcases
}
